package priv.pront.code.lanqiao.team.comp.mati_2;

import java.util.Scanner;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-11-02 21:40
 */
public class P1098_字符串的展开 {

    static int a, b, c;
    static String s;
    static StringBuilder sb = new StringBuilder("");

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        a = scanner.nextInt(); b = scanner.nextInt(); c = scanner.nextInt();
        s = scanner.next();

        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '-') {
                int preIdx = Math.max(i - 1, 0);
                int behIdx = Math.min(i + 1, s.length() - 1);
                if(s.charAt(preIdx) + 1 == s.charAt(behIdx)) continue;
                if (!add(preIdx, behIdx)) sb.append(s.charAt(i));
            } else {
                sb.append(s.charAt(i));
            }
        }

        System.out.println(sb.toString());
    }

    private static boolean add(int start, int end) {
        int i = s.charAt(start);
        int j = s.charAt(end);
        if (j - i >= 25 || j - i <= 1) return false;
        if (a == 1 && i >= 65 && i <= 90) {
//      如果是大写规定小写
            i += 32;
            j += 32;
        } else if (a == 2 && i >= 97 && i <= 122) {
//            如果是小写规定大写
            i -= 32;
            j -= 32;
        }else if(a == 3){
            int n = b * (j - i - 1);
            for (int k = 0; k < n; k++) {
                sb.append("*");
            }
            return true;
        }
        if (c == 1) {
            for (int k = i + 1; k < j; k++) {
                for (int l = 0; l < b; l++) {
                    sb.append((char) k);
                }
            }
        } else {
            for (int k = j - 1; k > i; k--) {
                for (int l = 0; l < b; l++) {
                    sb.append((char) k);
                }
            }

        }
        return true;
    }
}
